import { GroupData } from "babylon-lib/data/base-data";
import { Vector3Data } from "babylon-lib/data/datas/vector3-data";
import { NumberData } from "babylon-lib/data/datas/number-data";
import { Vector3 } from '@babylonjs/core/Maths/math.vector';
import { BooleanData } from 'babylon-lib/data/datas/boolean-data';
import { DEGREE } from 'babylon-lib/tool/calculation';
import { MessageHub } from "../../../common/global/message-hub";
import { EDIT_HUB_MESSAGE_TYPE } from "../../../common/global/edit-hub-message-type";


/**
 * 数据：
 * rootData:{
 *      isProduction:boolean data,
 *      cameraData:{
 *          cameraAlpha:number data,
 *          cameraBeta:number data,
 *          cameraRadius:number data,
 *          cameraTarget:Vector3 data, 
 *      },
 * };
 */


const rootData = new GroupData();

const isProduction = new BooleanData(false);

const cameraData = new GroupData();
const cameraAlpha = new NumberData(90 * DEGREE);
const cameraBeta = new NumberData(80 * DEGREE);
const cameraRadius = new NumberData(3);
const cameraTarget = new Vector3Data(new Vector3(0, 1, 0));
cameraData.add(cameraAlpha, cameraBeta, cameraRadius, cameraTarget);

const outfitIndex = new NumberData(0);

rootData.add(
    cameraData,
);


const actionReset = new BooleanData(false);
actionReset.force = true;
const screenShot = new BooleanData(false);
screenShot.force = true;


const Global: {
    hub?: MessageHub<EDIT_HUB_MESSAGE_TYPE>,
} = {};


export {
    rootData,
    cameraData, cameraAlpha, cameraBeta, cameraRadius, cameraTarget,
    actionReset, isProduction,
    screenShot,
    outfitIndex,
    Global,
};